home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / dosex / ex8.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  474 b   |  19 lines

  1. Program Example8;
  2. uses Dos;
  3.  
  4. { Program to demonstrate the GetFAttr function. }
  5.  
  6. var
  7.   Attr : Word;
  8.   f    : File;
  9. begin
  10.   Assign(f,ParamStr(1));
  11.   GetFAttr(f,Attr);
  12.   WriteLn('File ',ParamStr(1),' has attribute ',Attr);
  13.   if (Attr and $20)<>0 then WriteLn('- Archive');
  14.   if (Attr and $10)<>0 then WriteLn('- Directory');
  15.   if (Attr and $4)<>0 then WriteLn('- Read-Only');
  16.   if (Attr and $2)<>0 then WriteLn('- System');
  17.   if (Attr and $1)<>0 then WriteLn('- Hidden');
  18. end.
  19.